**meta_pre_rep_MM2013.do
***This document contains the meta code for the following work. 

*If you use this code, please cite:
*Dafoe, Allan, John R. Oneal, and Bruce Russett. 2013. "The Democratic Peace: Weighing the Evidence and Cautious Inference." International Studies Quarterly. 

*and also cite the paper that this work responds to and from which much of the code and data comes: 

*Mousseau, Michael. 2013. "The Democratic Peace Unraveled: It's the Economy." International Studies Quarterly.

**
**If you don't have it, install mvpatterns by typing: findit mvpatterns

****
clear
set seed 1029283
global filetree /Users/Allan/Dropbox/!!Papers/Liberal Peace/12-02-21_ISQ_commentary/DOR_ISQ_2013_Replication/M_Rep

cd "$filetree"

set more off

log using "12-11-17_log", text replace

***Preparing
*p4v2010_1.dta
*gleditsch_dyad.dta
*beck_webb1.dta
*beck_webb2.dta
cd "$filetree"
do "data_prep.do"

*Produces 
*"12-06-13_mids.dta"
*"12-05-28_dem_CIE_analysis.dta"
cd "$filetree"
do "AD_data_merge.do"


***Analysis of Beck and Webb, and Maoz MID data***
cd "$filetree"
do "12-06-23_beck_webb_analysis.do"
*Produces correlation between ln(GDP) and Ln(LifeDeer), and examines Maoz DVs 

***Preparing "MM_precise.dta"***
cd "$filetree"
do "12-06-23_MM_precise_rep.do"


***Preparing "midata.dta"***
clear
cd "$filetree"
do "12-06-24_prep_mul-imputation.do"
	*calls: "12-06-11_country_year.do"
	*based on: "CINE Data Replication Do File.do"
	*creates "country_year_mimpute.dta"

capture log close


********** Now run .R code ***************
*Run "MI_Dem_CIE.r" in R to generate multiple imputation datasets. This will take a few hours.

*Once that is complete, run "meta_pre_rep_MM2013-2.do"
****************************************

